
	 //快捷菜单所在div
	 var divEle  = [];

	  //快捷菜单html模板
	 var ressTemp = "";

	 //弹出div层的类型: FAST_JUMP==>快速跳转,FAST_QUERY==>快速查询
	 var layerType = ["FAST_JUMP","FAST_QUERY"];

     //根据id查找dom元素
	function $(obj){return document.getElementById(obj)}

	//显示菜单
	function showNew(divtype){
		divEle[divtype].style.visibility="visible";
		divEle[divtype].style.display="block";
		divEle[divtype].focus();

	}



   //隐藏菜单
	function hideDivNew(divtype){
		divEle[divtype].style.display="none";

	}

   /* 显示快捷方式下拉列表时的onclick事件
    * otherHiddenIds:其它弹出对话框的id的集合,为了隐藏其它的对话框
    * actionUrl:访问后台的url,查询出快捷方式的list
	* divCss:div扩展样式(可以分别对div及里面的table,td,<a href="#"/>加样式)如：
			div的样式(其中position一定要设成absolute,left,top,right,height不要设)
			#drogmenu_div2{
				display:none;
				position: absolute;
				border:1px solid #C1C4CB;
				width:100px;
				background-color:#fff;
			}
			td的样式
			#drogmenu_div2 td{
			    height:24px;
				text-align:left;
			}
			超链接的样式
			#drogmenu_div2 td a{
				color:#000;
				padding-top:3px;
				padding-left:3px;
			}
			给td加上事件(鼠标放上面时的样式)
			#drogmenu_div2 td a:hover{
			    width:98px;
			    height:24px;
				color:#000;
				font-weight: normal;
				background-color:#FFF2A4;
				border-top:1px solid #FDD14C;
				border-bottom:1px solid #FDD14C;
				padding-top:5px;
			}
			drogmenu_div2是div的id，就是此参数divCss

	*
	*/


   function showCurrentCutMenus(otherHiddenId,actionUrl,divCss,divType){
        if(divEle[divType]==null){

        	createCutDiv(divCss,divType);
        }

        if($(otherHiddenId)!=null)
	         $(otherHiddenId).style.display="none";

		ressTemp = "";
    	actionUrl = actionUrl+"&cut_type="+divType;
		//cut_send_request("POST",actionUrl,null,"xml",function(){showShortcutList(divType);});//自己写的ajax方法
		//alert(actionUrl);
    	startRequest("POST",actionUrl,null,function(){showShortcutList(divType);});//ajaxtool.js里的方法
    }


	var jumpDivId = layerType[0]+"_div";
	var queryDivId = layerType[1]+"_div";

	function showFastQueryMenu(cutUrl){

	    showCurrentCutMenus(jumpDivId,cutUrl,queryDivId,layerType[1]);

	}

    function showFastJumpMenu(cutUrl){
    	showCurrentCutMenus(queryDivId,cutUrl,jumpDivId,layerType[0]);

    }

  //创建快捷菜单所在div
	function createCutDiv(newDivId,divFlag){
	  newDivEle  =  document.createElement("div");
	  newDivEle.id = newDivId;
	  newDivEle.style.position = "absolute";
	  newDivEle.style.zIndex =9999;
	  var clickEle =event.srcElement;
	  var clickObjHeight = clickEle.height==undefined?0:clickEle.height;
	  newDivEle.style.top = getOffset(clickEle)[1]  + clickObjHeight +"px";
	  newDivEle.style.left = getOffset(clickEle)[0];
	  divEle[divFlag] = newDivEle;
	  if(divFlag==layerType[0])
	  	newDivEle.attachEvent("onblur",function(){hideDivNew(divFlag);});
	  document.body.appendChild(newDivEle);

	}




	//div innerHTML初始化方法
	function initHtml(divType){

		 var divFirstInnerHtml;

		 var divLastInnerHtml;

	     if(divType == layerType[0]){

	        divFirstInnerHtml = "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
	        divLastInnerHtml = "</table>";

	     }

	     if(divType==layerType[1]){

	     	divFirstInnerHtml =  " <table width=\"200\" height=\"115\" border=\"0\" cellpadding=\"1\" cellspacing=\"1\" bordercolor=\"#262752\" bgcolor=\"262752\">";

	  		divFirstInnerHtml += "   <tr> <td width=\"176\" height=\"21\" align=\"left\" valign=\"middle\" class=\"fast_query_title\">查&nbsp;询</span></td>";

	  		divFirstInnerHtml += "    <td style=\"background-image: url(msgTopBg.gif); padding-right: 2px; padding-top: 2px\" valign=\"center\" align=\"right\" width=\"19\"><span title=\"关闭\" style=\"CURSOR: hand;color:white;font-size:12px;font-weight:bold;margin-right:4px;\" onClick=\"hideDivNew(\'"+layerType[1]+"\');\" >×</span></td>";

	  		divFirstInnerHtml += "                          </tr>";

	  		divFirstInnerHtml += "                          <tr>";

	  		divFirstInnerHtml += "                            <td height=\"91\" colspan=\"2\" align=\"center\" valign=\"middle\" background=\"images/bg_Prompt.gif\" bgcolor=\"#FFFFFF\"><table border=\"0\" cellspacing=\"5\">";

	  		divFirstInnerHtml += "                                <tr>";

	  		divFirstInnerHtml += "                                  <td align=\"left\"><select id=\"fastQuerySelect\" name=\"select2\" style=\"width:168px;\">";


	        divLastInnerHtml = "                                  </select></td>";

      		divLastInnerHtml +="                                </tr>";

		  	divLastInnerHtml +="                                <tr>";

		  	divLastInnerHtml +="                                  <td><input id=\"fastQueryPara\" name=\"fastQueryPara\" type=\"text\" size=\"26\" class=\"fast_query_inputtext\"></td>";

		  	divLastInnerHtml +="                                </tr>";

		  	divLastInnerHtml +="                                <tr>";

		  	divLastInnerHtml +="                                  <td align=\"center\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  onClick=\"jumpByQuery();\">";

		  	divLastInnerHtml +="                                      <tr>";

		  	divLastInnerHtml +="                                        <td class=\"buttonOffLeft\" id=\"btn1_21\"></td>";

		  	divLastInnerHtml +="                                        <td class=\"buttonOffMiddle\" id=\"btn1_22\" onblur=\"search_btn_change(2)\" onMouseOver=\"over_search_btn(2)\" onMouseOut=\"out_search_btn(2)\"><img src=\"images/ico_searchico.gif\" alt=\"\" border=\"0\" align=\"absmiddle\" /> 查";

		  	divLastInnerHtml +="                                          询</td>";

		  	divLastInnerHtml +="                                        <td class=\"buttonOffRight\" id=\"btn1_23\"></td>";

		  	divLastInnerHtml +="                                      </tr>";

		  	divLastInnerHtml +="                                  </table></td>";

		  	divLastInnerHtml +="                                </tr>";

		  	divLastInnerHtml +="                            </table></td>";

		  	divLastInnerHtml +="                          </tr>";

		  	divLastInnerHtml +="                        </table>";

	     }

	     return [divFirstInnerHtml,divLastInnerHtml];

	}

	//根据div类型初始它包含的部分html(主要是静态的那部分)
	var divInnerHtmlInit = [];
	divInnerHtmlInit[layerType[0]] = initHtml(layerType[0]);
	divInnerHtmlInit[layerType[1]] = initHtml(layerType[1]);

	//ajax回调方法
	function showShortcutList(divTy) {

		 //if (http_request.readyState == 4) {

		  //if (http_request.status == 200) {

			var xmlDom = http_51ajax.responseXml;

			var rootEle = xmlDom.documentElement;

			var dataList = new Array();

			if (rootEle) dataList = rootEle.getElementsByTagName('shortcut');

			else return ;
			var dataLen = dataList.length;
			for(var i=0;i<dataLen;i++){
			    var cutMode = dataList[i].childNodes[0].firstChild.nodeValue;
			    var url = dataList[i].childNodes[1].firstChild.nodeValue;

			    var menu = dataList[i].childNodes[2].firstChild.nodeValue;
				var Temp =  "";
				if(divTy == layerType[0]){
					Temp = "<tr><td><a href=\"#\" onmouseDown=\"changeFrameToFastPage(" + menu + "," + url+"," + "0>" + cutMode + '</a></td></tr>';
				}else{
				    if(i==0)
						Temp =  "<option value=\""+menu+"\" selected>"+cutMode+"</option>";
					else
					    Temp =  "<option value=\""+menu+"\">"+cutMode+"</option>";

				}
			    ressTemp= ressTemp+Temp;

			}
			var ifrHeight;
			var ifrWidth;
			if(divTy == layerType[0]){
			     ifrHeight = 24*dataLen + "px";
			     ifrWidth = 100+"px";

			}else{
				ifrHeight = 115;
				ifrWidth = 240;

			}
			var divIframeHtml = "<iframe src=\"javascript:false\" style=\"position:absolute; visibility:inherit; top:0px; left:0px; width:"+ifrWidth+"; height:"+ifrHeight+"; z-index:-1; filter=\'progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)\';\"></iframe>";
			divEle[divTy].innerHTML = divInnerHtmlInit[divTy][0] + ressTemp + divInnerHtmlInit[divTy][1] + divIframeHtml;
			showNew(divTy);

		//}

	  //}

	 }







	//函数绑定函数
	bindFunction = function (el, fucName) {
		return function () {
			return fucName.apply(el, arguments);
		};
	};



     //定位当前点击对象
	 function getOffset(el){
	   var x = 0;
	   var y = 0;

	   while(el){
		 x+= el.offsetLeft;

		 y+= el.offsetTop;

		 el = el.offsetParent;


	   }

	   return [x,y];

	}




    //ajax查询数据,反回xml数据文件
	var http_request = false;
	function cut_send_request(method,url,content,responseType,callback) {
	 http_request = false;
	 if(window.XMLHttpRequest) {
		  http_request = new XMLHttpRequest();
		  if (http_request.overrideMimeType) {
		   	http_request.overrideMimeType("text/xml");
		  }
	 }else if (window.ActiveXObject) {
	  try {
	   		http_request = new ActiveXObject("Msxml2.XMLHTTP");
	  	}catch (e) {
	  try {
	    	http_request = new ActiveXObject("Microsoft.XMLHTTP");
	   } catch (e) {}
	  }
	 }
	 if (!http_request) {
	  window.alert("XMLHttpRequest");
	  return false;
	 }
	 if(responseType.toLowerCase()=="text") {
	  http_request.onreadystatechange = callback;
	 }
	 else if(responseType.toLowerCase()=="xml") {
	  http_request.onreadystatechange = callback;
	 }
	 else {
	  return false;
	 }
	 if(method.toLowerCase()=="get") {
		  http_request.open(method, url, true);
		  http_request.setRequestHeader("If-Modified-Since","0");
	 }
	 else if(method.toLowerCase()=="post") {
		  http_request.open(method, url, true);
		  http_request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	 }

	 else {
		  window.alert("http");
		  return false;
	 }


	 http_request.send(content);

 }




	//快捷方式菜单跳转函数
	function changeFrameToFastPage(cutMenuIds,pageUrl,isPassPara){
		//alert(pageUrl);
	   if(cutMenuIds==null||cutMenuIds==""||cutMenuIds=="null"){
	   	  var win = window.showModalDialog(pageUrl,null,'dialogWidth:0px;dialogHeight:0px;help:no;status:no;scroll:no;center');
	   }

	   else{
	      var menuIds = cutMenuIds.split(",");

		  if(isPassPara == 1){//1表示有查询参数

		     var menuObj = document.getElementById(""+menuIds[menuIds.length-1]);
			 if(menuObj){
			 	var hrefObj = menuObj.firstChild;
			 	 if(hrefObj.href.indexOf('&')==-1){

			     	hrefObj.href +="&fastQueryPara="+$("fastQueryPara").value;
			     }else{
			        hrefObj.href = hrefObj.href.substring(0,hrefObj.href.lastIndexOf("=")+1)+$("fastQueryPara").value;
			     }
			 }


		  }

	      for (var i = 0 ; i < menuIds.length ; i++){
				var link_object = document.getElementById(eval('\"'+menuIds[i]+'\"'));
				if(link_object){

					  if(i>=2){
					  //动态触发对象事件
					      var evt = null;
					      if(evt == null)
					      {
						      evt = document.createEventObject();
							  //evt.type = 'onmousedown';
							  link_object.fireEvent('onmousedown', evt);
						  }
						  	var div_object = link_object.offsetParent.parentNode;
						  	div_object.style.display="none";

				       }else{

				      		link_object.click();
					 		link_object.firstChild.click();

				  		}

				}else{
					alert("找不到你选择的菜单，请检查传入的对象的ID是否正确!");
					break;
				}

		  }

	   }
	}


	//带参数的快捷查询菜单跳转
	function jumpByQuery(){

		  var menuIds = $("fastQuerySelect").options[$("fastQuerySelect").selectedIndex].value;

		  changeFrameToFastPage(menuIds,null,1);

		  hideDivNew(layerType[1]);

	}


	//查询按钮事件
	var old=1;
	function search_btn_change(i){
		old=i
	}
	function over_search_btn(i){
		changeButtionStyle(i,"buttonOnLeft|buttonOnMiddle|buttonOnRight");
	}

	function out_search_btn(i){
		changeButtionStyle(i,"buttonOffLeft|buttonOffMiddle|buttonOffRight");
	}


	function changeButtionStyle(i,buttionStyles){
	    var styles = buttionStyles.split("|");
	 	var new_td11="btn1_"+i+"1";
		var new_td21="btn1_"+i+"2";
		var new_td31="btn1_"+i+"3";
		$(new_td11).className=styles[0];
		$(new_td21).className=styles[1];
		$(new_td31).className=styles[2];


	 }

